package com.zzyl.controller;

import com.zzyl.base.PageResponse;
import com.zzyl.base.ResponseResult;
import com.zzyl.dto.AlertDataHandleDto;
import com.zzyl.dto.AlertDataPageQueryDto;
import com.zzyl.service.AlertDataService;
import com.zzyl.vo.AlertDataVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/alert-data")
public class AlertDataController {
    @Autowired
    private AlertDataService alertDataService;
    @GetMapping("/pageQuery")
    public ResponseResult<PageResponse<AlertDataVo>> pageQuery(AlertDataPageQueryDto alertDataPageQueryDto){
        return ResponseResult.success(alertDataService.pageQuery(alertDataPageQueryDto));
    }
    @PutMapping("/handleAlertData/{id}")
    public ResponseResult handleAlertData(@PathVariable("id") Long id,
                                          @RequestBody AlertDataHandleDto alertDataHandleDto
                                          ){
        alertDataService.handleAlertData(id,alertDataHandleDto);
        return ResponseResult.success();
    }
}
